package com.ruoyi.project.product.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.product.domain.ProductsFile;
import com.ruoyi.project.product.mapper.ProductsFileMapper;
import com.ruoyi.project.product.service.ProductsFileService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class ProductsFileServiceImpl implements ProductsFileService

{

    @Autowired
    private ProductsFileMapper ProductsFileMapper;



    /**

     * 查询产品附件

     *

     * @param productsFileId 产品附件主键

     * @return 产品附件

     */

    @Override

    public ProductsFile selectProductsFileByProductsFileId(Long productsFileId)

    {

        return ProductsFileMapper.selectProductsFileByProductsFileId(productsFileId);

    }



    /**

     * 查询产品附件列表

     *

     * @param ProductsFile 产品附件

     * @return 产品附件

     */

    @Override

    public List<ProductsFile> selectProductsFileList(ProductsFile ProductsFile)

    {

        return ProductsFileMapper.selectProductsFileList(ProductsFile);

    }



    /**

     * 新增产品附件

     *

     * @param ProductsFile 产品附件

     * @return 结果

     */

    @Override

    public int insertProductsFile(ProductsFile ProductsFile)

    {

        ProductsFile.setCreateTime(DateUtils.getNowDate());

        return ProductsFileMapper.insertProductsFile(ProductsFile);

    }



    /**

     * 修改产品附件

     *

     * @param ProductsFile 产品附件

     * @return 结果

     */

    @Override

    public int updateProductsFile(ProductsFile ProductsFile)

    {

        ProductsFile.setUpdateTime(DateUtils.getNowDate());

        return ProductsFileMapper.updateProductsFile(ProductsFile);

    }



    /**

     * 批量删除产品附件

     *

     * @param productsFileIds 需要删除的产品附件主键

     * @return 结果

     */

    @Override

    public int deleteProductsFileByProductsFileIds(Long[] productsFileIds)

    {

        return ProductsFileMapper.deleteProductsFileByProductsFileIds(productsFileIds);

    }



    /**

     * 删除产品附件信息

     *

     * @param productsFileId 产品附件主键

     * @return 结果

     */

    @Override

    public int deleteProductsFileByProductsFileId(Long productsFileId)

    {

        return ProductsFileMapper.deleteProductsFileByProductsFileId(productsFileId);

    }

}
